package net.uhuijia.sys.sysversion.controller;

import net.uhuijia.utils.StringHelper;
import net.uhuijia.vo.ResultMapVo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import net.uhuijia.appbase.controller.BaseController;
import net.uhuijia.sys.sysversion.persistence.model.SysVersion;
import net.uhuijia.sys.sysversion.persistence.model.SysVersionExample;
import net.uhuijia.sys.sysversion.service.SysVersionService;


@RestController
@RequestMapping(value="/sysversion")
public class SysVersionController
     extends BaseController<SysVersionService,SysVersion,SysVersionExample> {

    /**
     * 获得当前安卓版本信息
     * @param project  工程名称
     */
    public ResultMapVo<SysVersion> getProjectAndroidVersion( String project ){
        if( StringHelper.isNotBlanks(project) ){
            SysVersion sysVersion = s.getProjectAndroidVersion(project);
            return ResultMapVo.ok(sysVersion);
        }else{
            throw new IllegalArgumentException();
        }
    }

    /**
     * 获得当前苹果版本信息
     * @param project  工程名称
     */
    public ResultMapVo<SysVersion> getProjectIosVersion( String project ){
        if( StringHelper.isNotBlanks(project) ){
            SysVersion sysVersion = s.getProjectIosVersion(project);
            return ResultMapVo.ok(sysVersion);
        }else{
            throw new IllegalArgumentException();
        }
    }
}